import request from '@/utils/request'

// 查询合同信息列表
export function listOaContract(query) {
  return request({
    url: '/contract/oaContract/list',
    method: 'get',
    params: query
  })
}

// 查询合同信息详细
export function getOaContract(id) {
  return request({
    url: '/contract/oaContract/' + id,
    method: 'get'
  })
}

// 保存合同信息
export function saveOaContract(data) {
  return request({
    url: '/contract/oaContract/save',
    method: 'post',
    data: data
  })
}

// 删除合同信息
export function delOaContract(id) {
  return request({
    url: '/contract/oaContract/' + id,
    method: 'delete'
  })
}

// 导出合同信息
export function exportOaContract(query) {
  return request({
    url: '/contract/oaContract/export',
    method: 'get',
    params: query
  })
}

// 删除合同付款信息
export function delOaContractPayment(id) {
  return request({
    url: '/contract/oaContract/payment/' + id,
    method: 'delete'
  })
}

// 删除合同付款计划
export function delOaContractPlan(id) {
  return request({
    url: '/contract/oaContract/plan/' + id,
    method: 'delete'
  })
}

// 删除合同关键条款
export function delOaContractTerms(id) {
  return request({
    url: '/contract/oaContract/terms/' + id,
    method: 'delete'
  })
}

// 合同下拉
export function selectToContract(query) {
  return request({
    url: '/contract/oaContract/selectToContract',
    method: 'get',
    params: query
  })
}

export function listDataContract(query) {
  return request({
    url: '/contract/oaContract/select',
    method: 'get',
    params: query
  })
}

// 根据合同ID获取该合同的付款计划
export function getOaContractPlanByMainId(id) {
  return request({
    url: '/contract/oaContract/getOaContractPlanByMainId/' + id,
    method: 'get'
  })
}

// 基金管理人 根据主体名称 根据Id查询lp_view 视图
export function getLpViewByMainBodyId(id) {
  return request({
    url: '/contract/oaContract/getLpViewByMainBodyId/' + id,
    method: 'get'
  })
}

// 用印中合同的下拉
export function selectSealList(query) {
  return request({
    url: '/contract/oaContract/selectSealList',
    method: 'get',
    params: query
  })
}

// 安信项目收款 合同下拉. 该下拉流程状态包含未审核的(包含了所有的合同. oa和项目的)
export function selectContractToAnxin(query) {
  return request({
    url: '/contract/oaContract/selectContractToAnxin',
    method: 'get',
    params: query
  })
}

// 统计新签合同
export function countNewContract(year) {
  return request({
    url: '/contract/oaContract/countNewContract/' + year,
    method: 'get'
  })
}

// 获取新签合同详情
export function getNewContractInfo(params) {
  return request({
    url: '/contract/oaContract/getNewContractInfo',
    method: 'get',
    params: params
  })
}

// 根据年查询 签约合同报表信息
export function reportByYear(params) {
  return request({
    url: '/contract/oaContract/reportByYear?year=' + params,
    method: 'get'

  })
}
// 根据年月查询新签合同详情
export function getSginContractInfo(params) {
  return request({
    url: '/contract/oaContract/reportDetailsByYear',
    method: 'get',
    params: params
  })
}
// 根据年查询 签约合同报表信息
export function reportByYearYoYChange(params) {
  return request({
    url: '/contract/oaContract/reportByYearYoYChange?year=' + params,
    method: 'get'

  })
}
